<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Jetson Inference: Image Formats</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="NVLogo_2D.jpg"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Jetson Inference
   </div>
   <div id="projectbrief">DNN Vision Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('group__imageFormat.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Image Formats<div class="ingroups"><a class="el" href="group__util.html">Utilities Library (jetson-utils)</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>Enumerations and helper functions for different types of image formats.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:ga931c48e08f361637d093355d64583406"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__imageFormat.html#ga931c48e08f361637d093355d64583406">imageFormat</a> { <br />
&#160;&#160;<a class="el" href="group__imageFormat.html#gga931c48e08f361637d093355d64583406a7e08074dcdc25f156e92c233807b048f">IMAGE_RGB8</a> =0, 
<a class="el" href="group__imageFormat.html#gga931c48e08f361637d093355d64583406aa36c106df206651efeeba8c7c1e7bddc">IMAGE_RGBA8</a>, 
<a class="el" href="group__imageFormat.html#gga931c48e08f361637d093355d64583406a9fd17a87f744486a238f2a7daf4143da">IMAGE_RGB32F</a>, 
<a class="el" href="group__imageFormat.html#gga931c48e08f361637d093355d64583406a9396c3fdae6987bbf4abc2b2e63e3815">IMAGE_RGBA32F</a>, 
<br />
&#160;&#160;<a class="el" href="group__imageFormat.html#gga931c48e08f361637d093355d64583406a81b5ebf9d84207d7400c60194b59196e">IMAGE_BGR8</a>, 
<a class="el" href="group__imageFormat.html#gga931c48e08f361637d093355d64583406acc6673d036d0aa620ad0a00a2b91a290">IMAGE_BGRA8</a>, 
<a class="el" href="group__imageFormat.html#gga931c48e08f361637d093355d64583406a940ed54272dc8e1c1bf14075b2d4dc3d">IMAGE_BGR32F</a>, 
<a class="el" href="group__imageFormat.html#gga931c48e08f361637d093355d64583406a216e1e9101020aa1dff70f7e8a0dab32">IMAGE_BGRA32F</a>, 
<br />
&#160;&#160;<a class="el" href="group__imageFormat.html#gga931c48e08f361637d093355d64583406a3cf92f3eaec5b2886b11a7d08ab2ee7b">IMAGE_YUYV</a>, 
<a class="el" href="group__imageFormat.html#gga931c48e08f361637d093355d64583406ac96c45814140e544d9ad4b905d1d0f9a">IMAGE_YUY2</a> =IMAGE_YUYV, 
<a class="el" href="group__imageFormat.html#gga931c48e08f361637d093355d64583406a5f9010b10d5865f2b1d8af2ffcd0b630">IMAGE_YVYU</a>, 
<a class="el" href="group__imageFormat.html#gga931c48e08f361637d093355d64583406afac3609232be82b7b33b45a4021e53eb">IMAGE_UYVY</a>, 
<br />
&#160;&#160;<a class="el" href="group__imageFormat.html#gga931c48e08f361637d093355d64583406aa59dd3d149443a1a7fc83302c6cd9642">IMAGE_I420</a>, 
<a class="el" href="group__imageFormat.html#gga931c48e08f361637d093355d64583406a803a5323476074e9fe0386152fc49139">IMAGE_YV12</a>, 
<a class="el" href="group__imageFormat.html#gga931c48e08f361637d093355d64583406a71df900ebdabeec1e39ee59f55bf9a96">IMAGE_NV12</a>, 
<a class="el" href="group__imageFormat.html#gga931c48e08f361637d093355d64583406a5c25062c34b2d7dee20002d4b5d1c136">IMAGE_BAYER_BGGR</a>, 
<br />
&#160;&#160;<a class="el" href="group__imageFormat.html#gga931c48e08f361637d093355d64583406a427ada330759aaa9016b25a5e759debc">IMAGE_BAYER_GBRG</a>, 
<a class="el" href="group__imageFormat.html#gga931c48e08f361637d093355d64583406a3696a5c9e323042d1330fa07cc871b3d">IMAGE_BAYER_GRBG</a>, 
<a class="el" href="group__imageFormat.html#gga931c48e08f361637d093355d64583406a83927ba3d7be52369555629cd5028b3a">IMAGE_BAYER_RGGB</a>, 
<a class="el" href="group__imageFormat.html#gga931c48e08f361637d093355d64583406a15fa3f6f45c0373bb043300b819d364d">IMAGE_GRAY8</a>, 
<br />
&#160;&#160;<a class="el" href="group__imageFormat.html#gga931c48e08f361637d093355d64583406a34b0b09e48e4d6e7bd6adfed70e30c63">IMAGE_GRAY32F</a>, 
<a class="el" href="group__imageFormat.html#gga931c48e08f361637d093355d64583406a7ee606cb3797c8f28f8c474517ac770e">IMAGE_COUNT</a>, 
<a class="el" href="group__imageFormat.html#gga931c48e08f361637d093355d64583406ac9e52255f1b44bcb0257383d948c3153">IMAGE_UNKNOWN</a> =999, 
<a class="el" href="group__imageFormat.html#gga931c48e08f361637d093355d64583406a9c918c02414c3e7aada5a7d6fcf9024b">IMAGE_DEFAULT</a> =IMAGE_RGBA32F
<br />
 }</td></tr>
<tr class="memdesc:ga931c48e08f361637d093355d64583406"><td class="mdescLeft">&#160;</td><td class="mdescRight">The imageFormat enum is used to identify the pixel format and colorspace of an image.  <a href="group__imageFormat.html#ga931c48e08f361637d093355d64583406">More...</a><br /></td></tr>
<tr class="separator:ga931c48e08f361637d093355d64583406"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1838495803ba134f58e6d439af6811f1"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__imageFormat.html#ga1838495803ba134f58e6d439af6811f1">imageBaseType</a> { <a class="el" href="group__imageFormat.html#gga1838495803ba134f58e6d439af6811f1ac694eb83e35b05c767d18094e76b3491">IMAGE_UINT8</a>, 
<a class="el" href="group__imageFormat.html#gga1838495803ba134f58e6d439af6811f1a2e82b10a5ddb8c689c3593c15323099c">IMAGE_FLOAT</a>
 }</td></tr>
<tr class="memdesc:ga1838495803ba134f58e6d439af6811f1"><td class="mdescLeft">&#160;</td><td class="mdescRight">The imageBaseType enum is used to identify the base data type of an imageFormat - either uint8 or float.  <a href="group__imageFormat.html#ga1838495803ba134f58e6d439af6811f1">More...</a><br /></td></tr>
<tr class="separator:ga1838495803ba134f58e6d439af6811f1"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gaa0224d2f00c1258d2ea1b95a21d5a49d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__imageFormat.html#ga1838495803ba134f58e6d439af6811f1">imageBaseType</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__imageFormat.html#gaa0224d2f00c1258d2ea1b95a21d5a49d">imageFormatBaseType</a> (<a class="el" href="group__imageFormat.html#ga931c48e08f361637d093355d64583406">imageFormat</a> format)</td></tr>
<tr class="memdesc:gaa0224d2f00c1258d2ea1b95a21d5a49d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the base type of an image format (uint8 or float).  <a href="group__imageFormat.html#gaa0224d2f00c1258d2ea1b95a21d5a49d">More...</a><br /></td></tr>
<tr class="separator:gaa0224d2f00c1258d2ea1b95a21d5a49d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2b4c4ed467ca1be0526e8b6dc81ccb1b"><td class="memItemLeft" align="right" valign="top">const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__imageFormat.html#ga2b4c4ed467ca1be0526e8b6dc81ccb1b">imageFormatToStr</a> (<a class="el" href="group__imageFormat.html#ga931c48e08f361637d093355d64583406">imageFormat</a> format)</td></tr>
<tr class="memdesc:ga2b4c4ed467ca1be0526e8b6dc81ccb1b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert an imageFormat enum to a string.  <a href="group__imageFormat.html#ga2b4c4ed467ca1be0526e8b6dc81ccb1b">More...</a><br /></td></tr>
<tr class="separator:ga2b4c4ed467ca1be0526e8b6dc81ccb1b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9292745783c6ce5d209c2bf5dd02f301"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__imageFormat.html#ga931c48e08f361637d093355d64583406">imageFormat</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__imageFormat.html#ga9292745783c6ce5d209c2bf5dd02f301">imageFormatFromStr</a> (const char *str)</td></tr>
<tr class="memdesc:ga9292745783c6ce5d209c2bf5dd02f301"><td class="mdescLeft">&#160;</td><td class="mdescRight">Parse an imageFormat enum from a string.  <a href="group__imageFormat.html#ga9292745783c6ce5d209c2bf5dd02f301">More...</a><br /></td></tr>
<tr class="separator:ga9292745783c6ce5d209c2bf5dd02f301"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga95cdbe993bce3c036d4941f2c3913f74"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__imageFormat.html#ga95cdbe993bce3c036d4941f2c3913f74">imageFormatChannels</a> (<a class="el" href="group__imageFormat.html#ga931c48e08f361637d093355d64583406">imageFormat</a> format)</td></tr>
<tr class="memdesc:ga95cdbe993bce3c036d4941f2c3913f74"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the number of image channels in each format.  <a href="group__imageFormat.html#ga95cdbe993bce3c036d4941f2c3913f74">More...</a><br /></td></tr>
<tr class="separator:ga95cdbe993bce3c036d4941f2c3913f74"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga48d21d2cc2f8822e13ee6d40e3719ba4"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__imageFormat.html#ga48d21d2cc2f8822e13ee6d40e3719ba4">imageFormatDepth</a> (<a class="el" href="group__imageFormat.html#ga931c48e08f361637d093355d64583406">imageFormat</a> format)</td></tr>
<tr class="memdesc:ga48d21d2cc2f8822e13ee6d40e3719ba4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the pixel bit depth (in bits, not bytes).  <a href="group__imageFormat.html#ga48d21d2cc2f8822e13ee6d40e3719ba4">More...</a><br /></td></tr>
<tr class="separator:ga48d21d2cc2f8822e13ee6d40e3719ba4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae8779cdbde4c4543a26a736ef7222fae"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__imageFormat.html#gae8779cdbde4c4543a26a736ef7222fae">imageFormatSize</a> (<a class="el" href="group__imageFormat.html#ga931c48e08f361637d093355d64583406">imageFormat</a> format, size_t width, size_t height)</td></tr>
<tr class="memdesc:gae8779cdbde4c4543a26a736ef7222fae"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compute the size of an image (in bytes)  <a href="group__imageFormat.html#gae8779cdbde4c4543a26a736ef7222fae">More...</a><br /></td></tr>
<tr class="separator:gae8779cdbde4c4543a26a736ef7222fae"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga08cfd96f1a84b8b583030ab095619b51"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__imageFormat.html#ga08cfd96f1a84b8b583030ab095619b51">imageFormatIsRGB</a> (<a class="el" href="group__imageFormat.html#ga931c48e08f361637d093355d64583406">imageFormat</a> format)</td></tr>
<tr class="memdesc:ga08cfd96f1a84b8b583030ab095619b51"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check if an image format is one of the RGB/RGBA formats.  <a href="group__imageFormat.html#ga08cfd96f1a84b8b583030ab095619b51">More...</a><br /></td></tr>
<tr class="separator:ga08cfd96f1a84b8b583030ab095619b51"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gade7534c202b20e289c1cc0b69c66770b"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__imageFormat.html#gade7534c202b20e289c1cc0b69c66770b">imageFormatIsBGR</a> (<a class="el" href="group__imageFormat.html#ga931c48e08f361637d093355d64583406">imageFormat</a> format)</td></tr>
<tr class="memdesc:gade7534c202b20e289c1cc0b69c66770b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check if an image format is one of the BGR/BGRA formats.  <a href="group__imageFormat.html#gade7534c202b20e289c1cc0b69c66770b">More...</a><br /></td></tr>
<tr class="separator:gade7534c202b20e289c1cc0b69c66770b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga339c56a589a78dc7af3666f192423525"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__imageFormat.html#ga339c56a589a78dc7af3666f192423525">imageFormatIsYUV</a> (<a class="el" href="group__imageFormat.html#ga931c48e08f361637d093355d64583406">imageFormat</a> format)</td></tr>
<tr class="memdesc:ga339c56a589a78dc7af3666f192423525"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check if an image format is one of the YUV formats.  <a href="group__imageFormat.html#ga339c56a589a78dc7af3666f192423525">More...</a><br /></td></tr>
<tr class="separator:ga339c56a589a78dc7af3666f192423525"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga52426c52d787b1f7525a57aab747ad6c"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__imageFormat.html#ga52426c52d787b1f7525a57aab747ad6c">imageFormatIsGray</a> (<a class="el" href="group__imageFormat.html#ga931c48e08f361637d093355d64583406">imageFormat</a> format)</td></tr>
<tr class="memdesc:ga52426c52d787b1f7525a57aab747ad6c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check if an image format is one of the grayscale formats.  <a href="group__imageFormat.html#ga52426c52d787b1f7525a57aab747ad6c">More...</a><br /></td></tr>
<tr class="separator:ga52426c52d787b1f7525a57aab747ad6c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf6ccf410de715a19c571887e58f4cee7"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__imageFormat.html#gaf6ccf410de715a19c571887e58f4cee7">imageFormatIsBayer</a> (<a class="el" href="group__imageFormat.html#ga931c48e08f361637d093355d64583406">imageFormat</a> format)</td></tr>
<tr class="memdesc:gaf6ccf410de715a19c571887e58f4cee7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check if an image format is one of the Bayer formats.  <a href="group__imageFormat.html#gaf6ccf410de715a19c571887e58f4cee7">More...</a><br /></td></tr>
<tr class="separator:gaf6ccf410de715a19c571887e58f4cee7"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Enumerations and helper functions for different types of image formats. </p>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="ga1838495803ba134f58e6d439af6811f1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1838495803ba134f58e6d439af6811f1">&#9670;&nbsp;</a></span>imageBaseType</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__imageFormat.html#ga1838495803ba134f58e6d439af6811f1">imageBaseType</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The imageBaseType enum is used to identify the base data type of an imageFormat - either uint8 or float. </p>
<p>For example, the IMAGE_RGB8 format has a base type of uint8, while IMAGE_RGB32F is float.</p>
<p>You can retrieve the base type of each format with <a class="el" href="group__imageFormat.html#gaa0224d2f00c1258d2ea1b95a21d5a49d" title="Get the base type of an image format (uint8 or float).">imageFormatBaseType()</a> </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga1838495803ba134f58e6d439af6811f1ac694eb83e35b05c767d18094e76b3491"></a>IMAGE_UINT8&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="gga1838495803ba134f58e6d439af6811f1a2e82b10a5ddb8c689c3593c15323099c"></a>IMAGE_FLOAT&#160;</td><td class="fielddoc"></td></tr>
</table>

</div>
</div>
<a id="ga931c48e08f361637d093355d64583406"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga931c48e08f361637d093355d64583406">&#9670;&nbsp;</a></span>imageFormat</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__imageFormat.html#ga931c48e08f361637d093355d64583406">imageFormat</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The imageFormat enum is used to identify the pixel format and colorspace of an image. </p>
<p>Supported data types are based on <code>uint8</code> and <code>float</code>, with colorspaces including RGB/RGBA, BGR/BGRA, grayscale, YUV, and Bayer.</p>
<p>There are also a variety of helper functions available that provide info about each format at runtime - for example, the pixel bit depth (<a class="el" href="group__imageFormat.html#ga48d21d2cc2f8822e13ee6d40e3719ba4" title="Get the pixel bit depth (in bits, not bytes).">imageFormatDepth()</a>) the number of image channels (<a class="el" href="group__imageFormat.html#ga95cdbe993bce3c036d4941f2c3913f74" title="Get the number of image channels in each format.">imageFormatChannels()</a>), and computing the size of an image from it's dimensions (</p><dl class="section see"><dt>See also</dt><dd><a class="el" href="group__imageFormat.html#gae8779cdbde4c4543a26a736ef7222fae" title="Compute the size of an image (in bytes)">imageFormatSize()</a>). To convert between <a class="el" href="group__image.html" title="Loading and saving image files from disk.">Image I/O</a> formats using the GPU, there is also the <a class="el" href="group__colorspace.html#ga2befa65dbc92689a36a367993d1ad673" title="Convert between two image formats using the GPU.">cudaConvertColor()</a> function.</dd></dl>
<p>In addition to the enums below, each format can also be identified by a string. The string corresponding to each format is included in the documentation below. These strings are more commonly used from Python, but can also be used from C++ with the <a class="el" href="group__imageFormat.html#ga9292745783c6ce5d209c2bf5dd02f301" title="Parse an imageFormat enum from a string.">imageFormatFromStr()</a> and <a class="el" href="group__imageFormat.html#ga2b4c4ed467ca1be0526e8b6dc81ccb1b" title="Convert an imageFormat enum to a string.">imageFormatToStr()</a> functions. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga931c48e08f361637d093355d64583406a7e08074dcdc25f156e92c233807b048f"></a>IMAGE_RGB8&#160;</td><td class="fielddoc"><p>uchar3 RGB8 (&lsquo;'rgb8&rsquo;`) </p>
</td></tr>
<tr><td class="fieldname"><a id="gga931c48e08f361637d093355d64583406aa36c106df206651efeeba8c7c1e7bddc"></a>IMAGE_RGBA8&#160;</td><td class="fielddoc"><p>uchar4 RGBA8 (&lsquo;'rgba8&rsquo;`) </p>
</td></tr>
<tr><td class="fieldname"><a id="gga931c48e08f361637d093355d64583406a9fd17a87f744486a238f2a7daf4143da"></a>IMAGE_RGB32F&#160;</td><td class="fielddoc"><p>float3 RGB32F (&lsquo;'rgb32f&rsquo;`) </p>
</td></tr>
<tr><td class="fieldname"><a id="gga931c48e08f361637d093355d64583406a9396c3fdae6987bbf4abc2b2e63e3815"></a>IMAGE_RGBA32F&#160;</td><td class="fielddoc"><p>float4 RGBA32F (&lsquo;'rgba32f&rsquo;`) </p>
</td></tr>
<tr><td class="fieldname"><a id="gga931c48e08f361637d093355d64583406a81b5ebf9d84207d7400c60194b59196e"></a>IMAGE_BGR8&#160;</td><td class="fielddoc"><p>uchar3 BGR8 (&lsquo;'bgr8&rsquo;`) </p>
</td></tr>
<tr><td class="fieldname"><a id="gga931c48e08f361637d093355d64583406acc6673d036d0aa620ad0a00a2b91a290"></a>IMAGE_BGRA8&#160;</td><td class="fielddoc"><p>uchar4 BGRA8 (&lsquo;'bgra8&rsquo;`) </p>
</td></tr>
<tr><td class="fieldname"><a id="gga931c48e08f361637d093355d64583406a940ed54272dc8e1c1bf14075b2d4dc3d"></a>IMAGE_BGR32F&#160;</td><td class="fielddoc"><p>float3 BGR32F (&lsquo;'bgr32f&rsquo;`) </p>
</td></tr>
<tr><td class="fieldname"><a id="gga931c48e08f361637d093355d64583406a216e1e9101020aa1dff70f7e8a0dab32"></a>IMAGE_BGRA32F&#160;</td><td class="fielddoc"><p>float4 BGRA32F (&lsquo;'bgra32f&rsquo;`) </p>
</td></tr>
<tr><td class="fieldname"><a id="gga931c48e08f361637d093355d64583406a3cf92f3eaec5b2886b11a7d08ab2ee7b"></a>IMAGE_YUYV&#160;</td><td class="fielddoc"><p>YUV YUYV 4:2:2 packed (&lsquo;'yuyv&rsquo;`) </p>
</td></tr>
<tr><td class="fieldname"><a id="gga931c48e08f361637d093355d64583406ac96c45814140e544d9ad4b905d1d0f9a"></a>IMAGE_YUY2&#160;</td><td class="fielddoc"><p>Duplicate of YUYV (&lsquo;'yuy2&rsquo;`) </p>
</td></tr>
<tr><td class="fieldname"><a id="gga931c48e08f361637d093355d64583406a5f9010b10d5865f2b1d8af2ffcd0b630"></a>IMAGE_YVYU&#160;</td><td class="fielddoc"><p>YUV YVYU 4:2:2 packed (&lsquo;'yvyu&rsquo;`) </p>
</td></tr>
<tr><td class="fieldname"><a id="gga931c48e08f361637d093355d64583406afac3609232be82b7b33b45a4021e53eb"></a>IMAGE_UYVY&#160;</td><td class="fielddoc"><p>YUV UYVY 4:2:2 packed (&lsquo;'uyvy&rsquo;`) </p>
</td></tr>
<tr><td class="fieldname"><a id="gga931c48e08f361637d093355d64583406aa59dd3d149443a1a7fc83302c6cd9642"></a>IMAGE_I420&#160;</td><td class="fielddoc"><p>YUV I420 4:2:0 planar (&lsquo;'i420&rsquo;`) </p>
</td></tr>
<tr><td class="fieldname"><a id="gga931c48e08f361637d093355d64583406a803a5323476074e9fe0386152fc49139"></a>IMAGE_YV12&#160;</td><td class="fielddoc"><p>YUV YV12 4:2:0 planar (&lsquo;'yv12&rsquo;`) </p>
</td></tr>
<tr><td class="fieldname"><a id="gga931c48e08f361637d093355d64583406a71df900ebdabeec1e39ee59f55bf9a96"></a>IMAGE_NV12&#160;</td><td class="fielddoc"><p>YUV NV12 4:2:0 planar (&lsquo;'nv12&rsquo;`) </p>
</td></tr>
<tr><td class="fieldname"><a id="gga931c48e08f361637d093355d64583406a5c25062c34b2d7dee20002d4b5d1c136"></a>IMAGE_BAYER_BGGR&#160;</td><td class="fielddoc"><p>8-bit Bayer BGGR (&lsquo;'bayer-bggr&rsquo;`) </p>
</td></tr>
<tr><td class="fieldname"><a id="gga931c48e08f361637d093355d64583406a427ada330759aaa9016b25a5e759debc"></a>IMAGE_BAYER_GBRG&#160;</td><td class="fielddoc"><p>8-bit Bayer GBRG (&lsquo;'bayer-gbrg&rsquo;`) </p>
</td></tr>
<tr><td class="fieldname"><a id="gga931c48e08f361637d093355d64583406a3696a5c9e323042d1330fa07cc871b3d"></a>IMAGE_BAYER_GRBG&#160;</td><td class="fielddoc"><p>8-bit Bayer GRBG (&lsquo;'bayer-grbg&rsquo;`) </p>
</td></tr>
<tr><td class="fieldname"><a id="gga931c48e08f361637d093355d64583406a83927ba3d7be52369555629cd5028b3a"></a>IMAGE_BAYER_RGGB&#160;</td><td class="fielddoc"><p>8-bit Bayer RGGB (&lsquo;'bayer-rggb&rsquo;`) </p>
</td></tr>
<tr><td class="fieldname"><a id="gga931c48e08f361637d093355d64583406a15fa3f6f45c0373bb043300b819d364d"></a>IMAGE_GRAY8&#160;</td><td class="fielddoc"><p>uint8 grayscale (&lsquo;'gray8&rsquo;`) <br  />
 </p>
</td></tr>
<tr><td class="fieldname"><a id="gga931c48e08f361637d093355d64583406a34b0b09e48e4d6e7bd6adfed70e30c63"></a>IMAGE_GRAY32F&#160;</td><td class="fielddoc"><p>float grayscale (&lsquo;'gray32f&rsquo;`) </p>
</td></tr>
<tr><td class="fieldname"><a id="gga931c48e08f361637d093355d64583406a7ee606cb3797c8f28f8c474517ac770e"></a>IMAGE_COUNT&#160;</td><td class="fielddoc"><p>The number of image formats. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga931c48e08f361637d093355d64583406ac9e52255f1b44bcb0257383d948c3153"></a>IMAGE_UNKNOWN&#160;</td><td class="fielddoc"><p>Unknown/undefined format. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga931c48e08f361637d093355d64583406a9c918c02414c3e7aada5a7d6fcf9024b"></a>IMAGE_DEFAULT&#160;</td><td class="fielddoc"><p>Default format (IMAGE_RGBA32F) </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="gaa0224d2f00c1258d2ea1b95a21d5a49d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa0224d2f00c1258d2ea1b95a21d5a49d">&#9670;&nbsp;</a></span>imageFormatBaseType()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__imageFormat.html#ga1838495803ba134f58e6d439af6811f1">imageBaseType</a> imageFormatBaseType </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__imageFormat.html#ga931c48e08f361637d093355d64583406">imageFormat</a>&#160;</td>
          <td class="paramname"><em>format</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Get the base type of an image format (uint8 or float). </p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__imageFormat.html#ga1838495803ba134f58e6d439af6811f1" title="The imageBaseType enum is used to identify the base data type of an imageFormat - either uint8 or flo...">imageBaseType</a> </dd></dl>

</div>
</div>
<a id="ga95cdbe993bce3c036d4941f2c3913f74"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga95cdbe993bce3c036d4941f2c3913f74">&#9670;&nbsp;</a></span>imageFormatChannels()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">size_t imageFormatChannels </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__imageFormat.html#ga931c48e08f361637d093355d64583406">imageFormat</a>&#160;</td>
          <td class="paramname"><em>format</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Get the number of image channels in each format. </p>
<p>For example, IMAGE_RGB8 has 3 channels, while IMAGE_RGBA8 has 4. </p>

</div>
</div>
<a id="ga48d21d2cc2f8822e13ee6d40e3719ba4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga48d21d2cc2f8822e13ee6d40e3719ba4">&#9670;&nbsp;</a></span>imageFormatDepth()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">size_t imageFormatDepth </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__imageFormat.html#ga931c48e08f361637d093355d64583406">imageFormat</a>&#160;</td>
          <td class="paramname"><em>format</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Get the pixel bit depth (in bits, not bytes). </p>
<p>The bit depth is the size in bits of each pixel in the image. For example, IMAGE_RGB8 has a bit depth of 24. This function returns bits instead of bytes, because some formats have a bit depth that's not evenly divisible by 8 (a byte). YUV 4:2:0 formats like I420, YV12, and NV12 have a depth of 12 bits. <br  />
</p>
<p>If you are calculating the overall size of an image, it's recommended to use the <a class="el" href="group__imageFormat.html#gae8779cdbde4c4543a26a736ef7222fae" title="Compute the size of an image (in bytes)">imageFormatSize()</a> function instead. It will automatically convert to bytes. </p>

</div>
</div>
<a id="ga9292745783c6ce5d209c2bf5dd02f301"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9292745783c6ce5d209c2bf5dd02f301">&#9670;&nbsp;</a></span>imageFormatFromStr()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__imageFormat.html#ga931c48e08f361637d093355d64583406">imageFormat</a> imageFormatFromStr </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>str</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Parse an imageFormat enum from a string. </p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__imageFormat.html#ga931c48e08f361637d093355d64583406" title="The imageFormat enum is used to identify the pixel format and colorspace of an image.">imageFormat</a> for the strings that correspond to each format. </dd></dl>
<dl class="section return"><dt>Returns</dt><dd>the imageFormat, or IMAGE_UNKNOWN on an unrecognized string. </dd></dl>

</div>
</div>
<a id="gaf6ccf410de715a19c571887e58f4cee7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf6ccf410de715a19c571887e58f4cee7">&#9670;&nbsp;</a></span>imageFormatIsBayer()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool imageFormatIsBayer </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__imageFormat.html#ga931c48e08f361637d093355d64583406">imageFormat</a>&#160;</td>
          <td class="paramname"><em>format</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Check if an image format is one of the Bayer formats. </p>
<dl class="section return"><dt>Returns</dt><dd>true if the imageFormat is a Bayer format (IMAGE_BAYER_BGGR, IMAGE_BAYER_GBRG, IMAGE_BAYER_GRBG, IMAGE_BAYER_RGGB) otherwise, returns false. </dd></dl>

</div>
</div>
<a id="gade7534c202b20e289c1cc0b69c66770b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gade7534c202b20e289c1cc0b69c66770b">&#9670;&nbsp;</a></span>imageFormatIsBGR()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool imageFormatIsBGR </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__imageFormat.html#ga931c48e08f361637d093355d64583406">imageFormat</a>&#160;</td>
          <td class="paramname"><em>format</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Check if an image format is one of the BGR/BGRA formats. </p>
<dl class="section return"><dt>Returns</dt><dd>true if the imageFormat is a BGR/BGRA format (IMAGE_BGR8, IMAGE_BGRA8, IMAGE_BGR32F, IMAGE_BGRA32F) otherwise, returns false. </dd></dl>

</div>
</div>
<a id="ga52426c52d787b1f7525a57aab747ad6c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga52426c52d787b1f7525a57aab747ad6c">&#9670;&nbsp;</a></span>imageFormatIsGray()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool imageFormatIsGray </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__imageFormat.html#ga931c48e08f361637d093355d64583406">imageFormat</a>&#160;</td>
          <td class="paramname"><em>format</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Check if an image format is one of the grayscale formats. </p>
<dl class="section return"><dt>Returns</dt><dd>true if the imageFormat is grayscale (IMAGE_GRAY8, IMAGE_GRAY32) otherwise, returns false. </dd></dl>

</div>
</div>
<a id="ga08cfd96f1a84b8b583030ab095619b51"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga08cfd96f1a84b8b583030ab095619b51">&#9670;&nbsp;</a></span>imageFormatIsRGB()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool imageFormatIsRGB </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__imageFormat.html#ga931c48e08f361637d093355d64583406">imageFormat</a>&#160;</td>
          <td class="paramname"><em>format</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Check if an image format is one of the RGB/RGBA formats. </p>
<dl class="section return"><dt>Returns</dt><dd>true if the imageFormat is a RGB/RGBA format (IMAGE_RGB8, IMAGE_RGBA8, IMAGE_RGB32F, IMAGE_RGBA32F) otherwise, returns false. </dd></dl>

</div>
</div>
<a id="ga339c56a589a78dc7af3666f192423525"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga339c56a589a78dc7af3666f192423525">&#9670;&nbsp;</a></span>imageFormatIsYUV()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool imageFormatIsYUV </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__imageFormat.html#ga931c48e08f361637d093355d64583406">imageFormat</a>&#160;</td>
          <td class="paramname"><em>format</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Check if an image format is one of the YUV formats. </p>
<dl class="section return"><dt>Returns</dt><dd>true if the imageFormat is a YUV format (IMAGE_YUYV, IMAGE_YVYU, IMAGE_UYVY, IMAGE_I420, IMAGE_YV12, IMAGE_NV12) otherwise, returns false. </dd></dl>

</div>
</div>
<a id="gae8779cdbde4c4543a26a736ef7222fae"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae8779cdbde4c4543a26a736ef7222fae">&#9670;&nbsp;</a></span>imageFormatSize()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">size_t imageFormatSize </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__imageFormat.html#ga931c48e08f361637d093355d64583406">imageFormat</a>&#160;</td>
          <td class="paramname"><em>format</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>height</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Compute the size of an image (in bytes) </p>

</div>
</div>
<a id="ga2b4c4ed467ca1be0526e8b6dc81ccb1b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2b4c4ed467ca1be0526e8b6dc81ccb1b">&#9670;&nbsp;</a></span>imageFormatToStr()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const char* imageFormatToStr </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__imageFormat.html#ga931c48e08f361637d093355d64583406">imageFormat</a>&#160;</td>
          <td class="paramname"><em>format</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Convert an imageFormat enum to a string. </p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__imageFormat.html#ga931c48e08f361637d093355d64583406" title="The imageFormat enum is used to identify the pixel format and colorspace of an image.">imageFormat</a> for the strings that correspond to each format. </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated on Tue Mar 28 2023 14:27:58 for Jetson Inference by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.17 </li>
  </ul>
</div>
</body>
</html>
